package com.kaiwukj.android.ufamily.mvp.ui.page.home.mine;

import android.content.res.ColorStateList;
import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButtonDrawable;
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout;

import java.util.ArrayList;

public class PropertyAdapter extends BaseQuickAdapter<PropertyBean, BaseViewHolder> {

    //FFF07E7F FFF59F7E  FFF8C26E  FF8398D4
    public PropertyAdapter() {
        super(R.layout.item_mine_property, new ArrayList<>());
    }

    @Override
    protected void convert(BaseViewHolder helper, PropertyBean item) {
        QMUIRoundRelativeLayout group = helper.getView(R.id.container_item);
        QMUIRoundButtonDrawable drawable = (QMUIRoundButtonDrawable) group.getBackground();
        drawable.setBgData(ColorStateList.valueOf(Color.parseColor(item.getBgColor())));
        // group.setBackgroundColor(Color.parseColor(item.getBgColor()));
        helper.setText(R.id.tv_name, item.getTitle());
        helper.setText(R.id.tv_desc, item.getDesc());
    }
}
